<%--
Copyright (C) 2008 Jackson Harper (jackson@ximian.com)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
--%>

<%@ Control Language="C#" ClassName="TagCloudList" %>
<%@ Register Assembly="Gaia.WebWidgets" Namespace="Gaia.WebWidgets" TagPrefix="gaia" %>

<%@ Register Namespace="Grr.Web" TagPrefix="grurrah" %>
<%@ Import Namespace="Grr.Model" %>

<script runat="server">

    protected override bool OnBubbleEvent(object source, EventArgs args)
    {
        Gaia.WebWidgets.LinkButton lb = source as Gaia.WebWidgets.LinkButton;
        if (lb != null)
        {
            TagListRepeater.DataSource = Grurrah.GetTenHighestRatedNamesForTag(lb.Text);
            TagListRepeater.DataBind();
            new Effect ("tag_ol", Effect.TypeOfEffect.BlindDown);
            TagListPanel.ForceAnUpdate();
        }
        
        return base.OnBubbleEvent(source, args);
    }
</script>



<table>
    <tr>
        <td>
            <gaia:Image ID="Image1" runat="server" ImageUrl="~/media/select-a-category.jpg" />
        </td>
    </tr>
    <tr>
        <td>
            <grurrah:TagCloud ID="TagCloud" DataSourceID="PopularTagsDataSource" runat="server"></grurrah:TagCloud>
            <asp:ObjectDataSource ID="PopularTagsDataSource" runat="server" SelectMethod="GetPopularTags"
                TypeName="Grr.Model.Tag"></asp:ObjectDataSource>
        </td>
    </tr>
    <tr>
        <td style="height:150px;" valign="top">
            <gaia:Panel ID="TagListPanel" runat="server" Width="300">
                <ol id="tag_ol">
                    <asp:Repeater ID="TagListRepeater" runat="server">
                        <ItemTemplate>
                            <li><a href="Grurrah.aspx?g=<%# GrurrahString.ToUriString (Container.DataItem.ToString ()) %>"><%# GrurrahString.ToDbString (Container.DataItem.ToString ()) %></a></li>
                        </ItemTemplate>
                     </asp:Repeater>
                 </ol>
            </gaia:Panel>  
        </td>
    </tr>
</table>
          
